#!/usr/bin/python
# -*- coding: utf-8 -*-

import wx

class Example(wx.Frame):

    def __init__(self, *args, **kwds):
        super(Example, self).__init__(*args, **kwds)
        self.InitUI()

    def InitUI(self):
        panel = wx.Panel(self)
        btn = wx.Button(panel, label='Close', pos=(20,30))
        btn.Bind(wx.EVT_BUTTON, self.OnClose)
        self.SetSize((250, 200))
        self.SetTitle('Wx.Button')
        self.Centre()
        self.Show(True)

    def OnClose(self, e):
        self.Close(True)

def main():
    ex = wx.App()
    Example(None)
    ex.MainLoop()

if __name__ == '__main__':
    main()
